package cur.nature.admin;

import cur.nature.framework.core.log.LOG;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.ContextClosedEvent;

@Configuration
public class AdminListener {

    @Bean
    public ApplicationListener onAdminStart() {
        return (ApplicationListener<ApplicationReadyEvent>) event -> {
            LOG.info("Admin started-------------------------------");
        };
    };

    @Bean
    public ApplicationListener onAdminStop() {
        return (ApplicationListener<ContextClosedEvent>) event -> {
            LOG.info("Admin stopped-------------------------------");
        };
    }
}
